<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>keycode属性</title>
</head>
<body>
     <script>
        //  keyup 和 keydown 不区分大小写  A和a 一样
         document.addEventListener('keyup',function(e) {
             console.log('up' + e.keyCode);
         })
        //  keypress 区分大小写 A和a 不一样
         document.addEventListener('keypress',function(e) {
             console.log('press' + e.keyCode);
         })
     </script>
</body>
</html>